package com.base.binarytree;

public  class TreeNode{
    int val;
    TreeNode left;
    TreeNode right;
    public TreeNode(int val){
        this.val=val;
    }

    public TreeNode(int val, TreeNode left, TreeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof TreeNode){
            return this.val == ((TreeNode) obj).val;
        }else {
            return false;
        }

    }


}
